package com.lry.basic.jvm;

public class Test {
    private int i;
    public static void main(String[] args) {
        System.out.println(new Test().inc());

    }
    public int inc(){
        Test test = null;
        int x;
        try {
            x=1;
            test.inc();
            return x;//把 1读入操作数栈顶，ireturn 指令返回
        }catch (ArithmeticException e){
            x=2; //发生Exception异常，把 1读入操作数栈顶，ireturn 指令返回
            return x;
        }finally {
            x=3; //即使return 之后会执行这里，操作数栈顶并不会改变，所以返回值是1
        }
    }
}


